//
//  GRWebViewConfiguration.m
//  GroupCost_IOS
//
//  Created by apple on 2019/2/21.
//  Copyright © 2019年 apple. All rights reserved.
//

#import "GRWebViewConfiguration.h"

@implementation GRWebViewConfiguration

+ (instancetype)defaultConfiguration{
	GRWebViewConfiguration *configuration = [[GRWebViewConfiguration alloc] init];
	//允许视频播放
	configuration.allowsAirPlayForMediaPlayback = YES;
	// 允许在线播放
	configuration.allowsInlineMediaPlayback = YES;
	// 允许可以与网页交互，选择视图
	configuration.selectionGranularity = YES;
	// web内容处理池
	configuration.processPool = [[WKProcessPool alloc] init];
	//自定义配置,一般用于 js调用oc方法(OC拦截URL中的数据做自定义操作)
	WKUserContentController * UserContentController = [[WKUserContentController alloc]init];
	// 添加消息处理，注意：self指代的对象需要遵守WKScriptMessageHandler协议，结束时需要移除
	//    [UserContentController addScriptMessageHandler:self name:@""];
	// 是否支持记忆读取
	configuration.suppressesIncrementalRendering = YES;
	// 允许用户更改网页的设置
	configuration.userContentController = UserContentController;
	return configuration;
}

@end
